// 测试主函数
// #include "./model/hash-map.h"
#include "./model/binary-tree.h"
// #include "./model/linked-list.h"
// #include "./model/double-linked-list.h"

int main()
{
	// HashMap *map = createHashMap();
	// putMap(map, "k", "可莉");
	// putMap(map, "q", "七七");
	// putMap(map, "d", "迪奥娜");
	// putMap(map, "z", "早柚");
	// putMap(map, "n", "小吉祥草王");
	// putMap(map, "dl", "多莉");
	// printf("哈希表长度：%d\n", map->count);
	// printf("键:%s 值:%s\n", "k", getMap(map, "k"));
	// printf("键:%s 值:%s\n", "q", getMap(map, "q"));
	// printf("键:%s 值:%s\n", "d", getMap(map, "d"));
	// printf("键:%s 值:%s\n", "z", getMap(map, "z"));
	// printf("键:%s 值:%s\n", "n", getMap(map, "n"));
	// printf("键:%s 值:%s\n", "dl", getMap(map, "dl"));
	// removeKeyValue(map, "dl");
	// printf("哈希表长度：%d\n", map->count);
	// printf("键dl是否存在：%d\n", getMap(map, "dl"));
	char pre[] = "abdiecfgh";
	char in[] = "dibeacgfh";
	// char sp[] = "cfgh";
	// char si[] = "cgfh";
	BinaryTree t1 = createTreeByPreOrderAndInOrder(pre, 0, 8, in, 0, 8);
	preorderTraverse(t1);
	printf("\n");
	preorderTraverseNonRecursion(t1);
	inorderTraverse(t1);
	printf("\n");
	inorderTraverseNonRecursion(t1);
	postorderTraverse(t1);
	printf("\n");
	postorderTraverseNonRecursion(t1);
	// BinaryTree t2 = createTreeByPreOrderAndInOrder(sp, 0, 3, si, 0, 3);
	// printf("%d\n", isSubTree(t2, t1));
	// int array[] = {1, 2, 3, 4, 5, 6};
	// LinkedList list = createList(array, sizeof(array) / sizeof(int));
	// listInsert(list, 0, 0);
	// printList(list);
	// listInsert(list, 7, 7);
	// printList(list);
	// listInsert(list, 20, 2);
	// printList(list);
	// listDelete(list, 0);
	// printList(list);
	// listDelete(list, 1);
	// printList(list);
	// listDelete(list, 6);
	// printList(list);
	// DoubleLinkedList list = createDoubleLinkedList(array, sizeof(array) / sizeof(int));
	// printDoubleList(list);
	// doubleListInsert(list, 10, 0);
	// printDoubleList(list);
	// doubleListInsert(list, 70, 7);
	// printDoubleList(list);
	// doubleListInsert(list, 50, 5);
	// printDoubleList(list);
	// doubleListDelete(list, 0);
	// printDoubleList(list);
	// doubleListDelete(list, 7);
	// printDoubleList(list);
	// doubleListDelete(list, 4);
	// printDoubleList(list);
	return 0;
}